VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "CDXVBScreen"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Public m_lpdd As IDirectDraw2

Public Sub CreateFullScreen(hWnd As Long, Width As Integer, Height As Integer, BPP As Integer)
      Dim dwFlags As Long

      dwFlags = DDSCL_EXCLUSIVE Or DDSCL_FULLSCREEN Or DDSCL_ALLOWREBOOT Or DDSCL_ALLOWMODEX

      DirectDrawCreate ByVal 0&, m_lpdd, Nothing

      m_lpdd.SetCooperativeLevel hWnd, dwFlags
      
      m_lpdd.SetDisplayMode Width, Height, BPP, 0, 0
End Sub

Public Sub CloseCDXVBScreen()
      m_lpdd.SetCooperativeLevel 0, DDSCL_NORMAL
      m_lpdd.RestoreDisplayMode

      Set m_lpdd = Nothing
End Sub

Public Sub HideMouse()
      ShowCursor False
End Sub

Public Sub ShowMouse()
      ShowCursor True
End Sub

Private Sub Class_Terminate()
      Call CloseCDXVBScreen
End Sub
